<?php
/**
  *comment模型类
  */
class commentModel extends model{
	/**
	  *留言列表
	  */
	public function getAll($limit){
		//拼接SQL
	    $sql="select id,poster,comment,date,reply,mail,ip from comment order by
	    id desc limit $limit";
	    $data=$this->db->fetchAll($sql);
	    return $data;
	}
	  /**
	    *留言总数
		*/
	  public function getNumber(){
		   $data=$this->db->fetchRow("select count(*)from comment");
		   return $data['count(*)'];
	  }
}
   ?>